package com.panda.mall.common.mallElastic.feign;

import com.panda.mall.common.result.Result;
import feign.hystrix.FallbackFactory;


/**
 * author: tcy
 * createDate: 2023/2/3
 * description:订单降级处理
 */
public class ElasticFallbackFactory implements FallbackFactory<ElasticFeign> {

    @Override
    public ElasticFeign create(Throwable throwable) {

        return new ElasticFeign() {

            /**
             * 新建文档
             * @param id
             * @param index
             * @return
             */
            @Override
            public Result<String> addDocument(Long id, String index) {
                return Result.fail(null);
            }

            /**
             * 修改文档
             * @param id
             * @param eid
             * @param index
             * @return
             */
            @Override
            public Result<String> updateDocument(Long id, String eid, String index) {
                return Result.fail(null);
            }
        };

    }
}
